<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box {
            width: 500px;
            height: 500px;
            background-color: red;
        }

        .first:has(p) {
            color: #7cb305;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="first"></div>
    <p></p>
    <span></span>
    <p></p>
    <i></i>
</div>
</body>
</html>